Optimal. Leaf size=145 \[ -\frac {\log (1-\sin (c+d x))}{2 (a+b)^3 d}+\frac {\log (1+\sin (c+d x))}{2 (a-b)^3 d}-\frac {b \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^3 d}+\frac {b}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {2 a b}{\left (a^2-b^2\right )^2 d (a+b \sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {2747, 724, 815}
\begin {gather*} \frac {2 a b}{d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}+\frac {b}{2 d \left (a^2-b^2\right ) (a+b \sin (c+d x))^2}-\frac {b \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^3}-\frac {\log (1-\sin (c+d x))}{2 d (a+b)^3}+\frac {\log (\sin (c+d x)+1)}{2 d (a-b)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 724
Rule 815
Rule 2747
Rubi steps
\begin {align*} \int \frac {\sec (c+d x)}{(a+b \sin (c+d x))^3} \, dx &=\frac {b \text {Subst}\left (\int \frac {1}{(a+x)^3 \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {b \text {Subst}\left (\int \frac {a-x}{(a+x)^2 \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{\left (a^2-b^2\right ) d}\\ &=\frac {b}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {b \text {Subst}\left (\int \left (\frac {a-b}{2 b (a+b)^2 (b-x)}-\frac {2 a}{(a-b) (a+b) (a+x)^2}+\frac {-3 a^2-b^2}{(a-b)^2 (a+b)^2 (a+x)}+\frac {a+b}{2 (a-b)^2 b (b+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{\left (a^2-b^2\right ) d}\\ &=-\frac {\log (1-\sin (c+d x))}{2 (a+b)^3 d}+\frac {\log (1+\sin (c+d x))}{2 (a-b)^3 d}-\frac {b \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^3 d}+\frac {b}{2 \left (a^2-b^2\right ) d (a+b \sin (c+d x))^2}+\frac {2 a b}{\left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.63, size = 135, normalized size = 0.93 \begin {gather*} \frac {b \left (-\frac {\log (1-\sin (c+d x))}{b (a+b)^3}+\frac {\log (1+\sin (c+d x))}{(a-b)^3 b}-\frac {2 \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{(a-b)^3 (a+b)^3}+\frac {1}{\left (a^2-b^2\right ) (a+b \sin (c+d x))^2}+\frac {4 a}{(a-b)^2 (a+b)^2 (a+b \sin (c+d x))}\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.74, size = 130, normalized size = 0.90
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{2 \left (a -b \right )^{3}}-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{3}}+\frac {b}{2 \left (a -b \right ) \left (a +b \right ) \left (a +b \sin \left (d x +c \right )\right )^{2}}+\frac {2 a b}{\left (a +b \right )^{2} \left (a -b \right )^{2} \left (a +b \sin \left (d x +c \right )\right )}-\frac {b \left (3 a^{2}+b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}}{d}\) | \(130\) |
default | \(\frac {\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{2 \left (a -b \right )^{3}}-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{3}}+\frac {b}{2 \left (a -b \right ) \left (a +b \right ) \left (a +b \sin \left (d x +c \right )\right )^{2}}+\frac {2 a b}{\left (a +b \right )^{2} \left (a -b \right )^{2} \left (a +b \sin \left (d x +c \right )\right )}-\frac {b \left (3 a^{2}+b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}}{d}\) | \(130\) |
norman | \(\frac {\frac {6 a^{2} b^{2}-2 b^{4}}{4 d b \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}+\frac {\left (6 a^{2} b^{2}-2 b^{4}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d b \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}+\frac {\left (6 a^{3} b^{2}-10 a \,b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d b \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) d}-\frac {\left (3 a^{2}+b^{2}\right ) b \ln \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}{\left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right ) d}\) | \(323\) |
risch | \(\frac {i x}{a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}}+\frac {i c}{\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) d}-\frac {i x}{a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}}-\frac {i c}{d \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}+\frac {6 i b \,a^{2} x}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}+\frac {6 i b \,a^{2} c}{\left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right ) d}+\frac {2 i b^{3} x}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}+\frac {2 i b^{3} c}{\left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right ) d}+\frac {2 b \left (2 i a b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 i a b \,{\mathrm e}^{i \left (d x +c \right )}-5 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+b^{2} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right )^{2} \left (-a^{2}+b^{2}\right )^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right ) a^{2}}{\left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right ) d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{\left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right ) d}\) | \(565\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 223, normalized size = 1.54 \begin {gather*} -\frac {\frac {2 \, {\left (3 \, a^{2} b + b^{3}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} - \frac {4 \, a b^{2} \sin \left (d x + c\right ) + 5 \, a^{2} b - b^{3}}{a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4} + {\left (a^{4} b^{2} - 2 \, a^{2} b^{4} + b^{6}\right )} \sin \left (d x + c\right )^{2} + 2 \, {\left (a^{5} b - 2 \, a^{3} b^{3} + a b^{5}\right )} \sin \left (d x + c\right )} - \frac {\log \left (\sin \left (d x + c\right ) + 1\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} + \frac {\log \left (\sin \left (d x + c\right ) - 1\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 462 vs.
\(2 (139) = 278\).
time = 0.43, size = 462, normalized size = 3.19 \begin {gather*} -\frac {5 \, a^{4} b - 6 \, a^{2} b^{3} + b^{5} - 2 \, {\left (3 \, a^{4} b + 4 \, a^{2} b^{3} + b^{5} - {\left (3 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{3} b^{2} + a b^{4}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) + {\left (a^{5} + 3 \, a^{4} b + 4 \, a^{3} b^{2} + 4 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5} - {\left (a^{3} b^{2} + 3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{4} b + 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} + a b^{4}\right )} \sin \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{5} - 3 \, a^{4} b + 4 \, a^{3} b^{2} - 4 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5} - {\left (a^{3} b^{2} - 3 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{4} b - 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} - a b^{4}\right )} \sin \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, {\left (a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} d \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} d \sin \left (d x + c\right ) - {\left (a^{8} - 2 \, a^{6} b^{2} + 2 \, a^{2} b^{6} - b^{8}\right )} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.94, size = 242, normalized size = 1.67 \begin {gather*} -\frac {\frac {2 \, {\left (3 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}} - \frac {\log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} + \frac {\log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}} - \frac {9 \, a^{2} b^{3} \sin \left (d x + c\right )^{2} + 3 \, b^{5} \sin \left (d x + c\right )^{2} + 22 \, a^{3} b^{2} \sin \left (d x + c\right ) + 2 \, a b^{4} \sin \left (d x + c\right ) + 14 \, a^{4} b - 3 \, a^{2} b^{3} + b^{5}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} {\left (b \sin \left (d x + c\right ) + a\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.40, size = 169, normalized size = 1.17 \begin {gather*} \frac {\ln \left (a+b\,\sin \left (c+d\,x\right )\right )\,\left (\frac {1}{2\,{\left (a+b\right )}^3}-\frac {1}{2\,{\left (a-b\right )}^3}\right )}{d}+\frac {\frac {5\,a^2\,b-b^3}{2\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {2\,a\,b^2\,\sin \left (c+d\,x\right )}{a^4-2\,a^2\,b^2+b^4}}{d\,\left (a^2+2\,a\,b\,\sin \left (c+d\,x\right )+b^2\,{\sin \left (c+d\,x\right )}^2\right )}+\frac {\ln \left (\sin \left (c+d\,x\right )+1\right )}{2\,d\,{\left (a-b\right )}^3}-\frac {\ln \left (\sin \left (c+d\,x\right )-1\right )}{2\,d\,{\left (a+b\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________